package Interface;

import org.junit.Test;

import java.util.function.Function;

/**
 * Function<T，R>函数型接口
 * R apply(T t);
 */
public class TetsFunction {
    @Test
    public void test() {
        String strHandler = strHandler("\t\t\t小柚子爱学习   ", (str) -> str.trim());
        System.out.println(strHandler);
    }

    //需求 用于处理字符串；
    public String strHandler(String str, Function<String, String> fun) {
        return fun.apply(str);
    }
}
